package part11;

import java.util.Arrays;
import java.util.LinkedList;

/**
 * @author wcj
 * @Date 2021/5/20 17:53
 * @Version 1.0
 */
public class Part119<T> {

    /**
     * 使用LinkedList实现栈的功能
     */
    private LinkedList<T> stack = new LinkedList<T>();

    public void push(T v) {
        stack.addFirst(v);
    }

    public T peek() {
        return stack.getFirst();
    }

    public T pop() {
        return stack.removeFirst();
    }
}
